package com.xsomnus.spring_framework.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xsomnus.spring_framework.entity.UserFundsLog;
import com.xsomnus.spring_framework.mapper.UserFundsLogMapper;
import com.xsomnus.spring_framework.service.IUserFundsLogService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author @xsomnus666_xiawenye★
 * @since 2019/7/26 0026 12:07
 * - 才需学也,学需静也/非淡泊无以明志，非宁静无以致远
 */
@Service
public class UserFundsLogServiceImpl extends ServiceImpl<UserFundsLogMapper, UserFundsLog> implements IUserFundsLogService {


    @Override
    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
    public void saveFundsLog(String userId, Integer modified) {
        this.save(new UserFundsLog().setLeftFee(0).setModified(modified).setUserId(userId).setRemark("测试ddd"));
    }
}
